
public enum EnumDemo {
    RED,BLACK,GREEN,WHITE;
    public static void main(String[] args) {
//拿到枚举实例BLACK
        TestEnum testEnum = TestEnum.BLACK;
//拿到枚举实例RED
        TestEnum testEnum21 = TestEnum.RED;
        System.out.println(testEnum.compareTo(testEnum21));
        System.out.println(BLACK.compareTo(RED));
        System.out.println(RED.compareTo(BLACK));
    }
}
